UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lTVv2a2rsmms7MBHw1iPpiSLE8aT32IPbT/O+Mop/jM=' 
WHERE 
  key_id = '32ef5d2aec3b1c6e832ce11f93572b6202aa459f561656d9978b4e367ea53490' 
  AND (
    token = 'lTVv2a2rsmms7MBHw1iPpiSLE8aT32IPbT/O+Mop/jM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025