UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FqNSQgexyw8jGAOWoUpd2Ie5CoHQi6i9j6ICoRn4CUY=' 
WHERE 
  key_id = '7336d3868575bdb086e52f813aa62c8fc6adf048cc230a15088fdab5d40e0d30' 
  AND (
    token = 'FqNSQgexyw8jGAOWoUpd2Ie5CoHQi6i9j6ICoRn4CUY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030