UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oTHWudqB5u+QB7VkWB1aIq6eJyb4XaKBwM3HMumPxQY=' 
WHERE 
  key_id = '73ba694519270e0c6bacde4ff44b57b59fec0da3c61ecd409d516b44de106ff2' 
  AND (
    token = 'oTHWudqB5u+QB7VkWB1aIq6eJyb4XaKBwM3HMumPxQY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044