UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RfUSBK+H24p6XQ4uZOUYOSWz7BNnh1NiJWrF2GB/hdk=' 
WHERE 
  key_id = '7d009231d56c9b0588164f7f96c2253a755620ac671c6dbc86f7298e6c1b063f' 
  AND (
    token = 'RfUSBK+H24p6XQ4uZOUYOSWz7BNnh1NiJWrF2GB/hdk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024