UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5tadi1vqkPIpiJYP+2HNFgkHAJOXSLxtAODd0ED2ne8=' 
WHERE 
  key_id = '237fac0d80fb241550b75611378c6fb66467b595967c1c528fdfb872aec29da8' 
  AND (
    token = '5tadi1vqkPIpiJYP+2HNFgkHAJOXSLxtAODd0ED2ne8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040