UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'R9CtZliWDITf3HfIKWwkv4NlYtVpJzjwgTmEQp5lbEI=' 
WHERE 
  key_id = 'e4a11857eba5fb8f91182e1e6c3f1e16313c2e14bba43ab3cdb74ae3b20b48b4' 
  AND (
    token = 'R9CtZliWDITf3HfIKWwkv4NlYtVpJzjwgTmEQp5lbEI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023