UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Cw4w2Hekwvz+cDMkkkHK5t+HdvGVYtuCgj2nu8nXS08=' 
WHERE 
  key_id = '2a8bb3db64dc3e177e090a12d6ee6d6353ff39cf0b23b3d1e0fa70c42cfb513b' 
  AND (
    token = 'Cw4w2Hekwvz+cDMkkkHK5t+HdvGVYtuCgj2nu8nXS08=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021