UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H+wMWYeBKQiip6Nk+2ZW29Ow/JS5KFcrwCihjDTSxwc=' 
WHERE 
  key_id = '3ad62b26f2f68d043e3bd5f0f4c865bdea2034a1beded30de0ba29298515a374' 
  AND (
    token = 'H+wMWYeBKQiip6Nk+2ZW29Ow/JS5KFcrwCihjDTSxwc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029