UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xKgd+AUJFNQiTgwRBoHKBwmFfvdOAbNVh6xCz30GWEo=' 
WHERE 
  key_id = 'cb26fa620de91ac9354073b75a9c11351be306fd2042dc0adb83f157c36db45d' 
  AND (
    token = 'xKgd+AUJFNQiTgwRBoHKBwmFfvdOAbNVh6xCz30GWEo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053