UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V44choHof8bz1EVQTuWOS/rVcz9ECNSAuXE2XU4Ydoo=' 
WHERE 
  key_id = '47df84178917b9dd7bd69273a68d328be7f956bdb1e52e93ed73abd7602d739f' 
  AND (
    token = 'V44choHof8bz1EVQTuWOS/rVcz9ECNSAuXE2XU4Ydoo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034