UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4RmbiTNUkkHpfqV5yZUpPFYcTCaM4Y6DYb3U6Y5LOzM=' 
WHERE 
  key_id = 'c1a77599dfd8265d308217b140895b75ad91a152d2f41f56accb34bba50ebe25' 
  AND (
    token = '4RmbiTNUkkHpfqV5yZUpPFYcTCaM4Y6DYb3U6Y5LOzM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047