UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yH/lbnMs6yxynPZckktgjQrx3ITTSIakzsi6XSVOmgg=' 
WHERE 
  key_id = '244b827e76cc8c13db5500f893a62ab80425135532ae202de5d31e4036fd2244' 
  AND (
    token = 'yH/lbnMs6yxynPZckktgjQrx3ITTSIakzsi6XSVOmgg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032