UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+cgyp9eF79nZMohcULfTnS85pSZfFmbt0SF3okfxMdY=' 
WHERE 
  key_id = 'c466a030f2b7b49004ec17397c9da659d6af357a08cb29c9e1fdeb11edc39887' 
  AND (
    token = '+cgyp9eF79nZMohcULfTnS85pSZfFmbt0SF3okfxMdY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031