UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Pc0twy0spGXI5/XdqgLNLsCdnPCtQqGHNbHC7ED/0LI=' 
WHERE 
  key_id = '759c9e0f7f7234e3946a87e0d14be93d75e967277f7ae4c38752bf56c7ee8bfd' 
  AND (
    token = 'Pc0twy0spGXI5/XdqgLNLsCdnPCtQqGHNbHC7ED/0LI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016