UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/20B4+AbyjcBmTD72zhrVEPgQRclHzdEfSfzQivDV+c=' 
WHERE 
  key_id = '50f310d32d14265fdaf24cf44ec4971faf77cdd8f25f6d0d51324052ee85ddbd' 
  AND (
    token = '/20B4+AbyjcBmTD72zhrVEPgQRclHzdEfSfzQivDV+c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033