UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gyIs5MN4+afOfQNI3O+7hT9U2YfDHFNaauJv9v75aTQ=' 
WHERE 
  key_id = 'acf66b4a38e157a3f99d8346f14bfcdbaadc31082e1cd37128cd78284dc8d3c5' 
  AND (
    token = 'gyIs5MN4+afOfQNI3O+7hT9U2YfDHFNaauJv9v75aTQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00131