UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'N0lxWREc+MOBZlHoVhdmCIsiA7Oi5Q23N/6QPNiSmlo=' 
WHERE 
  key_id = '7263798eaac2bcda3503868dd61a01263e4fabc7fcba7556e536a6259cafa00c' 
  AND (
    token = 'N0lxWREc+MOBZlHoVhdmCIsiA7Oi5Q23N/6QPNiSmlo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018