UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6t/nsMdlksNhczvUJ6S7Y6UIXdwW99rdAvCfHjd4sGE=' 
WHERE 
  key_id = 'b2643fe172893dc7652d3cfd2fcb52c01e35087c608ccc2027f2940239dfac7e' 
  AND (
    token = '6t/nsMdlksNhczvUJ6S7Y6UIXdwW99rdAvCfHjd4sGE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014