UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zevRmgW5rKrLyPv4NJv2qBFFrOH/dN5r+osAEmgDZX8=' 
WHERE 
  key_id = 'ff8cb0fa5921d883b2fbecf0ec455c10519bc777a1c846b829095ce25281b04d' 
  AND (
    token = 'zevRmgW5rKrLyPv4NJv2qBFFrOH/dN5r+osAEmgDZX8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039