UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kmHSXFtEh5uwzzJiYxHPGjm/l6x4pQ7PR7iNIYPjll4=' 
WHERE 
  key_id = 'aa4b06e2f8f5062e3fbae28a4f7a8cb2affd2095a26d44bdab4619808027970f' 
  AND (
    token = 'kmHSXFtEh5uwzzJiYxHPGjm/l6x4pQ7PR7iNIYPjll4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027