UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vcfUCsQU1H9oWl9ux6JlGeqUYl2ld2NsR/1qi27gAF8=' 
WHERE 
  key_id = '0c8b7702960c491ad0c76983e732a8a8c2b7c6d386d7cb8cc519fc187269fe19' 
  AND (
    token = 'vcfUCsQU1H9oWl9ux6JlGeqUYl2ld2NsR/1qi27gAF8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00072