UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lDCjgRA9+VIvzWSx+Wic8fjs4QXCfCbSfnrwUDAGb8I=' 
WHERE 
  key_id = '2eba891cdac8b26f0d8964032f8cd3e15dd0769ea23bb716e5ca4138308e1a04' 
  AND (
    token = 'lDCjgRA9+VIvzWSx+Wic8fjs4QXCfCbSfnrwUDAGb8I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031