UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vP4eCsT+c8VwM0ouVTvxks8nGh/8uvTMMolv4Sys5Ds=' 
WHERE 
  key_id = 'a82b5803af2d082d68fb60b9c35c428b2eb3558437de70cd31c9a9946ba12caf' 
  AND (
    token = 'vP4eCsT+c8VwM0ouVTvxks8nGh/8uvTMMolv4Sys5Ds=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030