UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yeXfj5ZIf7wKDJmsFOk0rYEr84dy3t9kqvLRPcWnDFE=' 
WHERE 
  key_id = '34c69e360fffa32c039474684dd01d2985b7db6f3323ba3b4f231e01a26d32ed' 
  AND (
    token = 'yeXfj5ZIf7wKDJmsFOk0rYEr84dy3t9kqvLRPcWnDFE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029