UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o6DppQvZ0/T/bcQYHEu6k1kmV/0nLChCgdoTDEzbqJQ=' 
WHERE 
  key_id = '447a3ac2e1c4c342bc7230cbdbec4fef25aae0988027d5d5bbc3ed0221905cbf' 
  AND (
    token = 'o6DppQvZ0/T/bcQYHEu6k1kmV/0nLChCgdoTDEzbqJQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041