UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nboCmzJbRxN++L2GZVhpSYGX+pxREwsEAGm4/s4y/N4=' 
WHERE 
  key_id = '563f84b01895afc2d027c322e627d46bc8266314a798d825529b834a96eb8f42' 
  AND (
    token = 'nboCmzJbRxN++L2GZVhpSYGX+pxREwsEAGm4/s4y/N4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040