UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0aD5OzLseZYF5fogIxrkMs5HWM8fSCOXKFL1jzi7UmM=' 
WHERE 
  key_id = 'c83cd1bd505f8cc6185b7da4dcf8bbfa252debd6a2b239bd5a89743f79603d61' 
  AND (
    token = '0aD5OzLseZYF5fogIxrkMs5HWM8fSCOXKFL1jzi7UmM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00076