UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1TXUk+HTGmTYddNxwBsAWc1bPd1wuqJCpG95dAfVElM=' 
WHERE 
  key_id = '98fe42f0fb2f2b60ec376186ce0b54d2b7a1a6539ab3e8f8da87df4bfaded9b3' 
  AND (
    token = '1TXUk+HTGmTYddNxwBsAWc1bPd1wuqJCpG95dAfVElM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046