UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gsWI63zjIY2sVPowFtPcUq/BQ3tY0vpac9Ho5QAuHIE=' 
WHERE 
  key_id = '74f31f8311b4a6ef074abaec4e4f16b167dd5ac0677d0a56d58e60d3a206cd6a' 
  AND (
    token = 'gsWI63zjIY2sVPowFtPcUq/BQ3tY0vpac9Ho5QAuHIE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038