UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dJzC/Eob2lP8sZTrG0CYmVwpSQRImardyX4tGiqzOxI=' 
WHERE 
  key_id = '9d7ace5b1618a2eff3297e78c37a5ce9aa61db3a0c250f49e772b6224f1c33f4' 
  AND (
    token = 'dJzC/Eob2lP8sZTrG0CYmVwpSQRImardyX4tGiqzOxI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015