UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BROS8wC7NybUyJ+4LHK/D7Wj6wjZhSGlDDyi5BfVRgs=' 
WHERE 
  key_id = '3759aaa7594f1c3848e6124841a5cb94bfb4af28da95f68846a674323cc0a608' 
  AND (
    token = 'BROS8wC7NybUyJ+4LHK/D7Wj6wjZhSGlDDyi5BfVRgs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024