UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'en3+D2mBwnPynYjwRgOFK6D1cDea8rKfSvucDkBCMks=' 
WHERE 
  key_id = 'c5931de3d6bce1052b20bdda8c4fbea9086e2b39b02206c52828799592ef2d47' 
  AND (
    token = 'en3+D2mBwnPynYjwRgOFK6D1cDea8rKfSvucDkBCMks=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00072