UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1gx3JLtxCy3PparI6jWijGumkcSGf5JRRi3XqMZQoss=' 
WHERE 
  key_id = 'b09d4052b3225b05a7ada7727312a8ba750fe223c36cfde79f40a8ac5f6bbbff' 
  AND (
    token = '1gx3JLtxCy3PparI6jWijGumkcSGf5JRRi3XqMZQoss=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033