UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VUnNxTeJ6eLUoyuejUfhQNR+rH0kSWDNTInx3Mc+giQ=' 
WHERE 
  key_id = '0c9048ad70cba5eaeb470be75d39f7784295ae1219777bdf262abf464b6f6060' 
  AND (
    token = 'VUnNxTeJ6eLUoyuejUfhQNR+rH0kSWDNTInx3Mc+giQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022