UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z/Q0CxdRgq1fXNl92o76sY0k7PWS59rkTWkhL3TcjlA=' 
WHERE 
  key_id = '108067e3fbae88b26e40cf47e20862eff50336d0281314ea730e2679d759cd84' 
  AND (
    token = 'z/Q0CxdRgq1fXNl92o76sY0k7PWS59rkTWkhL3TcjlA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041